﻿using PlutoStudio.Net.Messages;
using PlutoStudio.Net.Tcp;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;

namespace PlutoStudio.Net
{
    public class AcceptedEventArgs : EventArgs
    {
        public TcpClient TcpClient { get; private set; }
        internal AcceptedEventArgs(TcpClient client)
        {
            TcpClient = client;
        }
    }

    public delegate void AcceptedEventHandler(object sender, AcceptedEventArgs e);

    public class ReceivedEventArgs : EventArgs
    {
        internal ReceivedEventArgs(EndPoint remoteEP, Message message)
        {
            this.Message = message;
            this.RemoteEndPoint = remoteEP;
        }

        public ReceivedEventArgs(Message message)
        {
            this.Message = message;
        }

        public Message Message { get; private set; }

        public EndPoint RemoteEndPoint { get; set; }
    }

    public class ErrorEventArgs : EventArgs
    {
        public Exception ExceptionObject { get; private set; }
        internal ErrorEventArgs(Exception exception)
        {
            ExceptionObject = exception;
        }
    }

    public delegate void ReceivedEventHandler(object sender, ReceivedEventArgs e);

    public delegate void ConnectedEventHandler(object sender, EventArgs e);

    public delegate void SendedEventHandler(object sender, EventArgs e);

    public delegate void ClosedEventHandler(object sender, EventArgs e);

    public delegate void ErrorEventHandler(object sender,ErrorEventArgs e);

}
